
package com.sailing.lianxi.thread.pr;

public class ChildThread implements Runnable{

    @Override
    public void run() {
        System.out.println("子线程开始："+Thread.currentThread().getName());
        for(int i=0;i<100;i++){
        }
        Thread.yield();
        System.out.println("子线程结束："+Thread.currentThread().getName());
    }
    
    public static void main(String[] args) {
        System.out.println("主线程开始："+Thread.currentThread().getName());
        ChildThread childThread = new ChildThread();
        Thread th = new Thread(childThread);
        th.start();
        System.out.println("主线程结束："+Thread.currentThread().getName());
    }

}

